-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 0 pax bug for multi-mission #625
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_ben_FwFm.py fails on this PR.
File "/mnt/c/OMDAO/om-Aviary/aviary/validation_cases/benchmark_tests/test_bench_FwFm.py", line 397, in test_bench_FwFm_SNOPT
compare_against_expected_values(prob, self.expected_dict)
File "/mnt/c/OMDAO/om-Aviary/aviary/validation_cases/benchmark_utils.py", line 48, in compare_against_expected_values
assert_near_equal(masses[-1], expected_masses[-1], tolerance=rtol)
File "/mnt/c/OMDAO/openmdao/openmdao/utils/assert_utils.py", line 583, in assert_near_equal
raise ValueError('actual %s, desired %s, %s error %s, tolerance %s'
ValueError: actual [43067.40134181], desired [62697.71513264], rel error 0.3130945641208417, tolerance 0.02
This code detects:
pax_provided True
design_pax_provided True
even though only Design information is provided in aircraft_for_bench_FwFm.csv
Examining aviary_options
what we find is that 'aircraft:crew_and_payload:num_business_class': (0, 'unitless'),
has been set before getting to the following code lines in preprocessor.py:
for key in pax_keys:
if key in aviary_options:
# mark that the user provided any information on mission passenger count
pax_provided = True
else:
# default all non-provided passenger info to 0
aviary_options.set_val(key, 0)
I will need to update docs once I have tests working |
mission_pax = aviary_options.get_val(Aircraft.CrewPayload.NUM_PASSENGERS) | ||
if mission_pax > design_pax: | ||
if verbosity >= 1: | ||
# TODO Should this be an error? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i would just warn on this, just in case the user wants to run a mission overloaded with passengers (though where do they sit?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.guinnessworldrecords.com/world-records/most-passengers-on-an-aircraft
Over 1k people were crammed on a 747 once! So we'd be able to model that flight now
It appears it is an issue stemming from the way This PR may need to stay on hold until we clean up how defaults work in the rest of Aviary, this approach should work with the new paradigm (all defaults come from metadata rather than using user inputs as a vehicle to get those values into the problem) |
Summary
Fixes a bug in the crew & payload preprocessor where providing a passenger count of 0 for a single mission was confused with not providing that particular passenger count variable at all, leading to overwriting mission pax count with design pax count.
Related Issues
Backwards incompatibilities
None
New Dependencies
None